<div id="header">
	<div id="logan">
		<a href="<?php echo base_url();?>" title="Trang chủ" ><img src="<?php echo base_url()."resources/images/logo.png";?>" alt="logo" /></a>
	</div>
	<div id="top">
			<div id = "login">
					<ul>
						<?php if(empty($username)){ ?>
						<li id="login-user">Đăng nhập</li>
						<?php } else {?>
						Chào <?php echo $username;?> (<a href="<?php echo base_url()?>functions/logout" title="Thoát">Thoát</a>)
						<?php }?>
					</ul>
			</div>
	</div>
	<div id="search">
	<?php echo form_open(current_url(),"id='frmSearch'"); ?>	
		<input type="button" id="btnSearch" value="" />
		<input type="text" value="<?php echo $txtSearch;?>" placeholder="ten khach hang" id="txtSearch" name="txtSearch" />		
		<input type="hidden" value="" id="txtSearchCust_ID" name="txtSearchCust_ID" />		
		<?php echo form_close(); ?>
	</div>
</div>
<div class="container"><?php if($username){?>
<div id="menu">
		<ul id="jMenu">
		<!-- 
			<li><a class="fNiv active">Trang chủ</a>
			</li>
		-->
			
			<?php if($menu){
				foreach($menu as $item){
					if(isset($item['url']))
						echo "<li><a class='fNiv ".$item['active']."' href='".base_url().$item['url']."'>".$item['name']."</a>";
					else echo "<li><a class='fNiv ".$item['active']."'>".$item['name']."</a>";
					if(isset($item['child'])){
						echo "<ul style='width:150px;z-index:100;'>";
						$i= count($item['child']);
						foreach($item['child'] as $itm){
							$s_checkpass = "";
							if($itm['checkpass']) $s_checkpass = "check-pass";
							echo '<li><a class="'.$s_checkpass.'" href="'.base_url().$itm['url'].'">'.$itm['name'].'</a></li>';
							$i--;
							if( $i >0)
								echo '<li class="line"></li>';
						}
						echo "</ul>";
					}
					echo "</li>";
				}
			}?>			
		
		</ul>
		<script type="text/javascript">
  $(document).ready(function(){
    $("#jMenu").jMenu();
	$("#jMenu a.check-pass").click(function(event){
		 event.preventDefault(); 
		 $("#check_pass_url").val($(this).attr("href"));
	});
  })
  function printPartOfPage(elementId)
             {
                var printContent = document.getElementById(elementId);
                var windowUrl = 'about:blank';
                var uniqueName = new Date();
                var windowName = 'Print' + uniqueName.getTime();
                var printWindow = window.open(windowUrl, windowName, 'left=50,top=50,width=500,height=500');
                 printWindow.document.write('<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>CSS/print.css" />');
				
                                                               printWindow.document.write("<center></center>"+printContent.innerHTML+"<center><input type='button' onclick='self.focus(); self.print();' value='IN'/></center>");
                                                                printWindow.document.close();
                                                                printWindow.focus();
                                                                printWindow.print();
                                                               // printWindow.close();
                }
</script>
	</div>	<?php } ?>